package coolingPoolDevice

import (
	"gorm.io/plugin/soft_delete"
	"xkginweb/global"
)

// 冷池检测项表

type QccCoolingPoolDevice struct {
	CoolingPoolDeviceId uint                  `gorm:"primary_key;AUTO_INCREMENT;comment:主键ID" json:"cooling_pool_device_id"`
	CreatedAt           global.LocalTime      `gorm:"type:datetime;comment:创建时间" json:"created_at"`
	UpdatedAt           global.LocalTime      `gorm:"type:datetime;comment:更新时间" json:"updated_at"`
	IsDeleted           soft_delete.DeletedAt `gorm:"type:bigint(20) unsigned;default:0;comment:是否删除" json:"is_deleted"`
	DeviceName          string                `gorm:"type:varchar(50);default:'';comment:设备名;NOT NULL" json:"device_name"`
	CoolingPoolId       uint                  `gorm:"type:bigint(20);comment:冷池id;NOT NULL" json:"cooling_pool_id"`
	RoomId              uint                  `gorm:"type:bigint(20);comment:房间id;NOT NULL" json:"room_id"`
	QccCoolingPool      *QccCoolingPool       `gorm:"foreignKey:CoolingPoolId;references:cooling_pool_id;" json:"cooling_pool"`
	QccRoom             *QccRoom              `gorm:"foreignKey:RoomId;references:room_id;" json:"room"`
	Type                string                `json:"type" gorm:"not null;default:'';comment:检查类型"`
}

type QccCoolingPoolDeviceList struct {
	CoolingPoolDeviceId uint   `gorm:"primary_key;AUTO_INCREMENT;comment:主键ID" json:"cooling_pool_device_id"`
	CoolingPoolId       uint   `gorm:"type:bigint(20);comment:冷池id;NOT NULL" json:"cooling_pool_id"`
	DeviceName          string `gorm:"type:varchar(50);default:'';comment:设备名;NOT NULL" json:"device_name"`
	Type                string `json:"type" gorm:"not null;default:'';comment:检查类型"`
}

func (QccCoolingPoolDevice) TableName() string {
	return "qcc_cooling_pool_device"
}

type QccCoolingPool struct {
	CoolingPoolId   uint   `gorm:"primarykey;comment:主键ID" json:"cooling_pool_id"` // 主键ID
	CoolingPoolName string `gorm:"type:varchar(50);comment:冷池名;NOT NULL;default:''" json:"cooling_pool_name"`
}

type QccRoom struct {
	RoomId   uint   `json:"room_id" gorm:"primarykey;comment:主键ID"` // 主键ID
	RoomName string `json:"room_name" gorm:"not null;default:'';comment:房间名"`
	RoomType int8   `json:"room_type" gorm:"not null;default:0;comment:房间类型 1进线房 2机房"`
}
